<template>
	<view class="achievement-page">
		<!-- 顶部导航 -->
		<view class="nav-header">
			<view class="back-btn" @tap="goBack">
				<text class="back-arrow">←</text>
			</view>
			<text class="title">全部成就</text>
		</view>
		
		<!-- 进度条 -->
		<view class="progress-bar">
			<view class="progress-track">
				<view class="progress-fill"></view>
			</view>
		</view>
		
		<!-- 成就列表 -->
		<view class="achievement-list">
			<!-- 已解锁成就 -->
			<view class="achievement-item unlocked">
				<image class="badge" src="/static/achievement.png" mode="aspectFit"></image>
				<view class="info">
					<text class="name">小试牛刀</text>
					<text class="status">已达成</text>
				</view>
			</view>
			
			<view class="achievement-item unlocked">
				<image class="badge" src="/static/achievement.png" mode="aspectFit"></image>
				<view class="info">
					<text class="name">初级卷卷</text>
					<text class="status">已达成</text>
				</view>
			</view>
			
			<!-- 未解锁成就 -->
			<view class="achievement-item locked">
				<image class="badge" src="/static/achievement.png" mode="aspectFit"></image>
				<view class="info">
					<text class="name">中级卷卷</text>
					<text class="progress">进度：1/30</text>
				</view>
				<image class="lock" src="/static/lock.png" mode="aspectFit"></image>
			</view>
			
			<view class="achievement-item locked">
				<image class="badge" src="/static/achievement.png" mode="aspectFit"></image>
				<view class="info">
					<text class="name">高级卷卷</text>
					<text class="progress">进度：1/99</text>
				</view>
				<image class="lock" src="/static/lock.png" mode="aspectFit"></image>
			</view>
			
			<view class="achievement-item locked">
				<image class="badge" src="/static/achievement.png" mode="aspectFit"></image>
				<view class="info">
					<text class="name">超级卷卷</text>
					<text class="progress">进度：1/999</text>
				</view>
				<image class="lock" src="/static/lock.png" mode="aspectFit"></image>
			</view>
		</view>
	</view>
</template>

<script setup>
const goBack = () => {
	uni.navigateBack()
}
</script>

<style lang="scss">
.achievement-page {
	min-height: 100vh;
	background-color: #E8F6F6;
	padding-bottom: env(safe-area-inset-bottom);
}

.nav-header {
	display: flex;
	align-items: center;
	padding: 60rpx 30rpx 20rpx;
	position: relative;
	
	.back-btn {
		position: absolute;
		left: 30rpx;
		
		.back-arrow {
			font-size: 40rpx;
			color: #333;
		}
	}
	
	.title {
		width: 100%;
		text-align: center;
		font-size: 34rpx;
		font-weight: bold;
		color: #333;
	}
}

.progress-bar {
	padding: 0 30rpx;
	margin-bottom: 30rpx;
	
	.progress-track {
		height: 8rpx;
		background: rgba(92, 211, 211, 0.2);
		border-radius: 4rpx;
		overflow: hidden;
		
		.progress-fill {
			width: 40%;  // 根据实际进度调整
			height: 100%;
			background: #5CD3D3;
			border-radius: 4rpx;
		}
	}
}

.achievement-list {
	padding: 0 30rpx;
	
	.achievement-item {
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 30rpx;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
		position: relative;
		
		.badge {
			width: 80rpx;
			height: 80rpx;
			margin-right: 20rpx;
		}
		
		.info {
			flex: 1;
			
			.name {
				font-size: 32rpx;
				color: #333;
				font-weight: bold;
				margin-bottom: 8rpx;
				display: block;
			}
			
			.status {
				font-size: 26rpx;
				color: #5CD3D3;
			}
			
			.progress {
				font-size: 26rpx;
				color: #999;
			}
		}
		
		&.locked {
			opacity: 0.6;
			
			.lock {
				width: 40rpx;
				height: 40rpx;
				position: absolute;
				right: 30rpx;
				top: 50%;
				transform: translateY(-50%);
			}
		}
	}
}
</style>
